package thirdpart.codec;

/**
 * @Author: Tzu
 * @Date: 2020/11/11 20:53
 * @Version: 1.0
 * @Description: 序列化和反序列化
 */

public interface IBodyCodec {

    //obj --> byte[] 序列化
    <T> byte[] serialize(T obj) throws Exception;

    //byte[] --> obj 反序列化
    <T> T deserialize(byte[] bytes,Class<T> clazz) throws Exception;
}
